using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessPlatform.Core;
using BusinessPlatform.Core.BusinessObject;
using BusinessPlatform.Core.BusinessObject.Mapping;
using BusinessPlatform.Core.BusinesObjectType;

namespace NewStartModels.Models.User
{
    /// <summary>
    /// 用户
    /// </summary>
    public class User : BusinessObjectBase, IUser, IMasterData
    {
        /// <summary>
        /// 用户
        /// </summary>
        public override string TableName
        {
            get { return "Users"; }
        }
        #region properties

        /// <summary>
        /// 对象
        /// </summary>
        [PropertyMapping(FieldName = "ObjType", DbType = typeof(String), DefaultValue = "User")]
        public System.String ObjectType
        {
            get { return this.GetPropertyValue<System.String>("ObjectType"); }
            set { this.SetPropertyValue<System.String>("ObjectType", value); }
        }

        /// <summary>
        /// 用户编号
        /// </summary>
        [PropertyMapping(FieldName = "UserID", DbType = typeof(Int32), IsPrimary = true)]
        public System.Int32 UserID
        {
            get { return this.GetPropertyValue<System.Int32>("UserID"); }
            set { this.SetPropertyValue<System.Int32>("UserID", value); }
        }

        /// <summary>
        /// 可用
        /// </summary>
        [PropertyMapping(FieldName = "Activated", DbType = typeof(String), DefaultValue = "N")]
        public BusinessPlatform.Data.Enumerator.BOYesOrNo Activated
        {
            get { return this.GetPropertyValue<BusinessPlatform.Data.Enumerator.BOYesOrNo>("Activated"); }
            set { this.SetPropertyValue<BusinessPlatform.Data.Enumerator.BOYesOrNo>("Activated", value); }
        }

        /// <summary>
        /// 创建人
        /// </summary>
        [PropertyMapping(FieldName = "Creator", DbType = typeof(Int32))]
        public System.Int32 Creator
        {
            get { return this.GetPropertyValue<System.Int32>("Creator"); }
            set { this.SetPropertyValue<System.Int32>("Creator", value); }
        }

        /// <summary>
        /// 创建时间
        /// </summary>
        [PropertyMapping(FieldName = "CreateDate", DbType = typeof(DateTime))]
        public System.DateTime CreateDate
        {
            get { return this.GetPropertyValue<System.DateTime>("CreateDate"); }
            set { this.SetPropertyValue<System.DateTime>("CreateDate", value); }
        }

        /// <summary>
        /// 更新人
        /// </summary>
        [PropertyMapping(FieldName = "Updator", DbType = typeof(Int32))]
        public System.Int32 Updator
        {
            get { return this.GetPropertyValue<System.Int32>("Updator"); }
            set { this.SetPropertyValue<System.Int32>("Updator", value); }
        }

        /// <summary>
        /// 更新时间
        /// </summary>
        [PropertyMapping(FieldName = "UpdateDate", DbType = typeof(DateTime))]
        public System.DateTime UpdateDate
        {
            get { return this.GetPropertyValue<System.DateTime>("UpdateDate"); }
            set { this.SetPropertyValue<System.DateTime>("UpdateDate", value); }
        }

        /// <summary>
        /// 用户代码
        /// </summary>
        [PropertyMapping(FieldName = "UserCode", DbType = typeof(String), IsUnionKey = true)]
        public System.String UserCode
        {
            get { return this.GetPropertyValue<System.String>("UserCode"); }
            set { this.SetPropertyValue<System.String>("UserCode", value); }
        }

        /// <summary>
        /// 用户名称
        /// </summary>
        [PropertyMapping(FieldName = "UserName", DbType = typeof(String))]
        public System.String UserName
        {
            get { return this.GetPropertyValue<System.String>("UserName"); }
            set { this.SetPropertyValue<System.String>("UserName", value); }
        }

        /// <summary>
        /// 密码
        /// </summary>
        [PropertyMapping(FieldName = "Password", DbType = typeof(String))]
        public System.String Password
        {
            get { return this.GetPropertyValue<System.String>("Password"); }
            set { this.SetPropertyValue<System.String>("Password", value); }
        }

        /// <summary>
        /// 超级用户
        /// </summary>
        [PropertyMapping(FieldName = "IsSupperUser", DbType = typeof(String), DefaultValue = "N")]
        public BusinessPlatform.Data.Enumerator.BOYesOrNo IsSupperUser
        {
            get { return this.GetPropertyValue<BusinessPlatform.Data.Enumerator.BOYesOrNo>("IsSupperUser"); }
            set { this.SetPropertyValue<BusinessPlatform.Data.Enumerator.BOYesOrNo>("IsSupperUser", value); }
        }

        /// <summary>
        /// 员工号
        /// </summary>
        [PropertyMapping(FieldName = "EmployeeID", DbType = typeof(Int32))]
        public System.Int32 EmployeeID
        {
            get { return this.GetPropertyValue<System.Int32>("EmployeeID"); }
            set { this.SetPropertyValue<System.Int32>("EmployeeID", value); }
        }

        /// <summary>
        /// 分属\分支
        /// </summary>
        [PropertyMapping(FieldName = "Branch", DbType = typeof(String))]
        public System.String Branch
        {
            get { return this.GetPropertyValue<System.String>("Branch"); }
            set { this.SetPropertyValue<System.String>("Branch", value); }
        }

        /// <summary>
        /// 部门
        /// </summary>
        [PropertyMapping(FieldName = "Department", DbType = typeof(String))]
        public System.String Department
        {
            get { return this.GetPropertyValue<System.String>("Department"); }
            set { this.SetPropertyValue<System.String>("Department", value); }
        }

        /// <summary>
        /// 备注
        /// </summary>
        [PropertyMapping(FieldName = "Remarks", DbType = typeof(String))]
        public System.String Remarks
        {
            get { return this.GetPropertyValue<System.String>("Remarks"); }
            set { this.SetPropertyValue<System.String>("Remarks", value); }
        }

        #endregion

        /// <summary>
        /// 用户构造函数
        /// </summary>
        public User()
        {

        }
    }
}
